<?php

defined('THINK_PATH') or exit();
/**
 * 行为扩展：模板内容输出替换
 */
class content_replaceBehavior extends Behavior {

    public function run(&$content){
        $content = $this->_replace($content);
    }

    private function _replace($content) {
        $replace = array();
        if(C('IS_Admin')) {
            $replace['__STATIC__'] =C('zyb_admin_url').'static';
        }else{
        	 $replace['__STATIC__'] = C('zyb_site_url')."static/frontend/";
        }
		$replace['__NSTATIC__'] =C('zyb_wx_url').'static/frond/';
        $content = str_replace(array_keys($replace),array_values($replace),$content);
        return $content;
    }
}